package com.kt.kvw.enums;


import com.kt.kvw.constant.ResultCodeConstants;

/**
 * Created with IntelliJ IDEA.
 * Desc:
 *
 * @author: keen
 * Date: 2020-07-05
 * Time: 13:29
 */
public enum ResultCodeEnum implements ErrorCode {
    SUCCESS(true, ResultCodeConstants.SUCCESS_CODE, "操作成功!"),
    FAIL(false, ResultCodeConstants.FAIL_CODE, "操作失败!"),
    PHONE_EXISTS(false, ResultCodeConstants.PHONE_EXISTS_CODE, "手机号码已存在");
    private boolean success;
    private int code;
    private String message;

    ResultCodeEnum(boolean success, int code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    public boolean success() {
        return success;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
